package com.woniuxy.rabbit.kill.rabbit;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * description: KillProductor <br>
 * date: 2022/1/15 4:33 下午 <br>
 * author: shesaifei <br>
 * version: 1.0 <br>
 */

@Component
public class KillProductor {

    @Resource
    private AmqpTemplate amqpTemplate;

    public void send(String userName) {
        System.out.println(userName + "begin kill");

        amqpTemplate.convertAndSend("kill_exchange", "kill", userName);
    }
}
